package com.jiangjiang.eshop.wms.chain;

import com.jiangjiang.eshop.finance.service.FinanceFacadeService;
import com.jiangjiang.eshop.wms.dto.PurchaseInputOrderDTO;
import com.jiangjiang.eshop.wms.dto.PurchaseInputOrderHandlerResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author Jianghaowen
 * @Date 2021/9/14
 * @Description: TODO
 * @Version V1.0
 **/
@Component
public class InformFinanceCenterHandler extends AbstractPurchaseInputOrderHandler {
    @Autowired
    private FinanceFacadeService financeFacadeService;

    /**
     * 通知财务中心创建采购结算单
     *
     * @param dto 采购入库单
     * @return
     * @throws Exception
     */
    @Override
    protected PurchaseInputOrderHandlerResult doExecute(PurchaseInputOrderDTO dto) throws Exception {
        financeFacadeService.createPurchaseSettlementOrder(dto);
        return new PurchaseInputOrderHandlerResult(true);
    }
}
